#include <iostream>
using namespace std;
class Animal
{
    public:
       Animal(int pid,string pname);
       int getnum();
       string getname();
       virtual void eat() = 0;
    private:
       int num;
       string name;
};
Animal::Animal(int pid, string pname)
{
    num = pid;
    name = pname;
}
int Animal::getnum()
{
    return num;
}
string Animal::getname()
{
    return name;
}

class Dog: public Animal
{
    public:
       Dog(int pnum,string pname);
       void eat();
};
Dog::Dog(int pnum, string pname):Animal(pnum,pname)
{

}
void Dog::eat()
{
    //cout<<num<<" "<<name <<" "<<endl;
    cout<<getnum()<<"号"<<getname() <<"啃骨头"<<endl;
}

class Cat: public Animal
{
    public:
       Cat(int pnum, string pname);
       void eat();
};

Cat::Cat(int pnum, string pname) : Animal(pnum,pname)
{

}
void Cat::eat()
{
    //cout<<num<<" "<<name <<" "<<endl;
    cout<<getnum()<<"号"<<getname() <<"吃小鱼"<<endl;
}
int main()
{
    Animal * p;
    int num;
    string name;
    cin>>num>>name;
    Dog dog(num,name);
    p = &dog;
    p->eat();
    cin>>num>>name;
    Cat cat(num,name);
    p = &cat;
    p->eat();
}